<?php
class get
{
    public static function test():bool{
        print_r($_SERVER);
        return true;
    }

    public static function phpinfo():bool
    {
        phpinfo();
        return true;
    }

    public static function getToolsList():bool
    {
        $array = json_decode(file_get_contents(FILES_PATH."/tools.json"),true);
        for ($i=0;$i<count($array);$i++){
            if ($a = @$array[$i]["link"]){
                $array[$i]["link"] = linkProcess("{LINK_$a}");
            }
        }
        $array = json_encode($array);
        print_r($array);
        return true;
    }

    public static function custom_gitee():bool
    {
        header('Content-Type:applcation/javascript');
        writeLog("Info",FILES_PATH."custom/custom_gitee.js");
        echo file_get_contents(FILES_PATH."custom/custom_gitee.js");
        return true;
    }

    public static function index():bool
    {

        loadHtml("index",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function mc_territory():bool
    {
        loadHtml("mc_territory",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function bilibili_video():bool
    {
        loadHtml("bilibili_video",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function douyin_video():bool
    {
        loadHtml("douyin_video",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function qq_info():bool
    {
        loadHtml("qq_info",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function qq_chat():bool
    {
        loadHtml("qq_chat",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function qq_group():bool
    {
        loadHtml("qq_group",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function qq_card():bool
    {
        loadHtml("qq_card",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function qq_pc_online():bool
    {
        loadHtml("qq_pc_online",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function site_title():bool
    {
        loadHtml("site_title",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function site_logo():bool
    {
        loadHtml("site_logo",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function netease_music():bool
    {
        loadHtml("netease_music",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function netease_music_hot():bool
    {
        loadHtml("netease_music_hot",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function qzonetors():bool
    {
        loadHtml("qzonetors",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function qqqtx():bool
    {
        loadHtml("qqqtx",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function epidemic():bool
    {
        loadHtml("epidemic",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function address():bool
    {
        loadHtml("address",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }

    public static function shortLink():bool
    {
        loadHtml("shortLink",false,["PHP_VER"=>phpversion(),"SetColor"=>file_get_contents(HTML_PATH."SetColor.html")]);
        return true;
    }
    




    /*API文档页面*/
    public static function doc():bool
    {
        $enableStatic=getProperty("enableStatic");
        if ($enableStatic==1){
            if (strpos($_SERVER["REQUEST_URI"],"/?/")>=2){
                header("Location:/doc");
            }
        }
        loadHtml("doc/index",false,["STATIC"=>$enableStatic]);
        return true;
    }

    public static function doc_QQ_card():bool
    {
        loadHtml("doc/qq_card",false,["HOST"=>$_SERVER["HTTP_HOST"],"STATIC"=>getProperty("enableStatic"),"PATH"=>"qq_card"]);
        return true;
    }

    public static function doc_QQ_info():bool
    {
        loadHtml("doc/qq_info",false,["HOST"=>$_SERVER["HTTP_HOST"],"STATIC"=>ENABLE_STATIC,"PATH"=>"qq_info"]);
        return true;
    }

    public static function doc_QQ_chat():bool
    {
        loadHtml("doc/qq_chat",false,["HOST"=>$_SERVER["HTTP_HOST"],"STATIC"=>ENABLE_STATIC,"PATH"=>"qq_chat"]);
        return true;
    }

    public static function doc_QQ_group():bool
    {
        loadHtml("doc/qq_group",false,["HOST"=>$_SERVER["HTTP_HOST"],"STATIC"=>ENABLE_STATIC,"PATH"=>"qq_group"]);
        return true;
    }

    public static function doc_QQ_pc_online():bool
    {
        loadHtml("doc/qq_pc_online",false,["HOST"=>$_SERVER["HTTP_HOST"],"STATIC"=>ENABLE_STATIC,"PATH"=>"qq_pc_online"]);
        return true;
    }






    /*API请求*/
    public static function api_QQ_card():bool
    {
        $qq = args_get("qq");
        $url = "https://api.vvhan.com/api/qqCard?qq=$qq";
        header("Location: $url");
        return true;
    }

    public static function api_QQ_info():bool
    {
        include(CORE_PATH."tools/post.php");
        return post::api_QQ_info();
    }

    public static function api_QQ_chat():bool
    {
        $qq = args_get("qq");
        $url = "https://api.uomg.com/api/qq.talk?qq=$qq";
        header("Location: $url");
        return true;
    }

    public static function api_QQ_group():bool
    {
        $qid = args_get("qid");
        $url = "https://api.uomg.com/api/qq.joingroup?qid=$qid";
        header("Location: $url");
        return true;
    }

    public static function api_QQ_pc_online():bool
    {
        return post::api_QQ_pc_online();
    }
}